import { makeAutoObservable } from 'mobx';
import type { TextItem, ImageItem } from '../../../types/type';

// 定义 store 类
class IndexStore {

    constructor() {
        makeAutoObservable(this, {}, { deep: false });
    }

    // 文本数组状态
    texts: TextItem[] = [];
    setTexts(texts: TextItem[]) {
        this.texts = texts;
    }

    // 图片数组状态
    imgs: ImageItem[] = [];
    setImgs(imgs: ImageItem[]) {
        this.imgs = imgs;
    }
    
}

// 创建并导出 store 实例
const indexStore = new IndexStore();
export default indexStore;